<!-- Begin SLIDER -->
<?php 
use_stylesheet('library/css/flexslider', '', array('media'=> 'all'));
use_javascript('/css/library/js/flex-slider/jquery.flexslider.js');

 


If(count($slides)>0):
$carousel='<div id="flexslider" class="flexslider"><ul class="slides">';
?>
<div id="carousel" class="flexslider">
		 <ul class="slides">
		<?php
		foreach ($slides as $slide):
			echo '<li>';
			$carousel .= '<li><img src="/imgThumb.php?s=960&mod=.&im='.$slide.'" /></li>';
			
		?>
		        	<img src="<?php echo '/imgThumb.php?s=240&mod=.&im='.$slide; ?>" /> 
        				
        <?php echo '</li>'; endforeach; ?>
        			</ul>
</div>
<?php $carousel .= '</ul></div>';
 echo $carousel; ?>

        	  <!-- SLIDER SETTINGS -->

    	   <script type="text/javascript">
				$j = jQuery.noConflict();
                $j(window).load(function() {
				  // The slider being synced must be initialized first
				  $j('#carousel').flexslider({
				    animation: "slide",
				    controlNav: false,
				    animationLoop: false,
				    slideshow: false,
				    itemWidth: 240,
				    itemMargin: 5,
				    asNavFor: '#flexslider',
				    
				  });/**/
				   
				  $j('#flexslider').flexslider({
				    animation: "slide",
				    easing: "swing",
				    controlNav: false,
				    animationLoop: false,
				    slideshow: false,
				    smoothHeight: true,
				    sync: "#carousel"/**/
				  });
				});/**/
				

    			</script>
<?php endif; ?>
    	   <!-- END SLIDER -->    
